
In this folder we try to have the parent process create
a real, two stage pipeline between two child processes.
This is attempting to do exactly what a shell program
(like bash on Linux or cmd.exe on Windows) does when you
use a pipe symbol in a command line.

C:\  program1.exe | program2.exe

Here are the steps that a shell program goes through to
"execute" this command line.

  1.) The shell program should create two child processes,
      one each from the files program1.exe and program2.exe,
  2.) The stdin of program1.exe should be inherited from the shell,
  3.) The stdout of program2.exe should be inherited from the shell,
  4.) The stdout of program1.exe should be "connected" to stdin
      of program2.exe.

Here is a diagram of how the parent and two child processes should
have their streams connected together.

                        parent
                    +------------+
                    |            |
          +--------->>0        1>>----------------------+
          |         |            |                      |
          |         |          2>>----> stderr          |
          |         |            |                      |
          |         |            |                      |
  stdin --+         +------------+                      +--> stdout
 (shared) |                                             |   (shared)
          |                                             |
          |       child1                   child2       |
          |   +------------+           +------------+   |
          |   |            |   pipe    |            |   |
          +-->>0         1>>---------->>0         1>>---+
              |            |           |            |
              |          2>>->stderr   |          2>>----> stderr
              |            |           |            |
              |            |           |            |
              +------------+           +------------+


Unfortunately, Java does not seem to be able to create a real
pipeline. We have to fake it using "pumps" running in threads
as we demonstrated in the previous folders.

Here is what the above diagram looks like when the pipes have
been replaced by "pumps". Be sure to correlate the code in the
appropriate source files with this diagram.


                          parent
                  +-----------------------+
                  |                       |
    stdin--------->>0-+               +-1>>-------> stdout
                  |   |               |   |
                  |   |               | 2>>-------> stderr
                  |   |     +----+    |   |
                  |   |     |    |    |   |
        +---------<<3-+     4    5    +-6<<------------+
        |         |        /\    \/       |            |
        |         +--------/\----\/-------+            |
        |                   |     |                    |
        |                   |     |                    |
        |       child1      |     |       child2       |
        |   +------------+  |     |   +------------+   |
        |   |            |  |     |   |            |   |
        +-->>0         1>>--+     +--->>0        1>>---+
            |            |            |            |
            |          2>>->stderr    |          2>>---> stderr
            |            |            |            |
            |            |            |            |
            +------------+            +------------+



From the documentation for Java 7, it seems that we should be able
to create a pipeline. But there are two problems. Inheritance of
standard streams does not work on Windows, and the inheritance of
standard streams on Linux does not quite work in the way the
documentation implies it should work (specifically, if the parent
redirects one of its standard streams, then it seems that a child
cannot inherit the new, redirected, standard stream).